#include <stdio.h>
#include "udpsr.hpp"
#include <string.h>
#include <cstring>
#include <iostream>
#include "RbcpConfig.hpp"
#include <unistd.h>
#define TIME_DELAY_CMD 100000
#define TEST

int main() {
	// UdpSR mUdpSR = UdpSR();
	// printf("hello\n");
	// char str[256] = {11}; //0xb
	// char abc = 11;

	// mUdpSR.rbcp("wrb", "0x1f", &abc); //wrb 0x1f 0xb
	// printf("%s\n", "");
	RbcpConfig r = RbcpConfig();
	r.reset();
	r.IpreConfig();
	usleep(TIME_DELAY_CMD);
	r.IshaConfig();
	usleep(TIME_DELAY_CMD);
	r.IbufConfig();
	usleep(TIME_DELAY_CMD);
	r.IcompConfig();
	usleep(TIME_DELAY_CMD);
	r.IdriverConfig();
	usleep(TIME_DELAY_CMD);
	r.VfpConfig();
	usleep(TIME_DELAY_CMD);
	r.VfsConfig();
	usleep(TIME_DELAY_CMD);
	r.Vref0Config();
	usleep(TIME_DELAY_CMD);
	r.Vref1Config();
	usleep(TIME_DELAY_CMD);
	r.VoffsetConfig();
	usleep(TIME_DELAY_CMD);
	r.AoutConfig();
	usleep(TIME_DELAY_CMD);
	r.TpRegConfig();
	usleep(TIME_DELAY_CMD);
	r.CRegConfig();
	usleep(TIME_DELAY_CMD);
	#ifdef TEST
	printf("============================================================================\n");
	r.CRegConfig();
	
	usleep(TIME_DELAY_CMD);
	#endif
	#if 0
	r.stop();
	#else 
	r.start();
	#endif
	return 0;
}
